import { WEBAPP_NAME, APP_FLIGHT_PATH, callService } from '@/common/common.js'

export function authWorkWeixinUser(params, cbDone) {
  const url = WEBAPP_NAME + '/ww/user'
  callService(url, {
    data: params,
    cbDone: cbDone
  })
}

export function searchUsers(params, cbDone, cbAlways, cbFail) {
  const url = APP_FLIGHT_PATH + '/ww/users'
  callService(url, {
    type: 'get',
    data: params, 
    cbDone: cbDone,
    cbAlways: cbAlways
  })
}

export function searchAppChats(params, cbDone, cbAlways, cbFail) {
  const url = APP_FLIGHT_PATH + '/ww/appChats'
  callService(url, {
    type: 'get',
    data: params, 
    cbDone: cbDone,
    cbAlways: cbAlways
  })
}

export function searchAppChat(params, cbDone, cbAlways, cbFail) {
  const url = APP_FLIGHT_PATH + '/ww/appChat'
  callService(url, {
    type: 'get',
    data: params, 
    cbDone: cbDone,
    cbAlways: cbAlways
  })
}

export function createAppChat(params, cbDone, cbAlways, cbFail) {
  const url = APP_FLIGHT_PATH + '/ww/appChat'
  callService(url, {
    data: params,
    cbDone: cbDone,
    cbAlways: cbAlways
  })
}


export function sendAppChat(params, cbDone, cbAlways, cbFail) {
  const url = APP_FLIGHT_PATH + '/ww/sendAppChat'
  callService(url, {
    data: params,
    cbDone: cbDone,
    cbAlways: cbAlways
  })
}